import yagmail
import logging

class Tools():
    #封装日志
    def log_info(self,filename,filemode):
        logging.basicConfig(
            filename=filename,
            filemode=filemode,
            format='%(asctime)s->%(levelname)s->%(message)s',
            level=logging.DEBUG)


    #发送邮件
    def send_eamil(self,subject,filename):
        send=yagmail.SMTP(user='1419002374@qq.com',password='pblpfajgpwcohfea',host='smtp.qq.com')
        send.send(to='1419002374@qq.com',subject=subject,attachments=filename,contents='测试报告')